<div class='right-cont right-cont-less wrap-motto' ng-controller='MottoList'>
	<div class='title'>语录列表<i class='fa fa-spinner fa-spin' ng-if='loading'></i></div>
	<div class='content'>
		<div class='box-ops'>
            <button class='btn btn-primary' data-toggle='modal' data-target='.modal.add-motto'>添加</button>
        </div>
        <div class='box-list'>
            <table class='table table-list'>
                <tr>
                    <td>语录ID <span class='fa fa-sort'></span></td>
                    <td>标题<span class='fa fa-sort'></span></td>
                    <td>图片<span class='fa fa-sort'></span></td>
                    <td>音频时长<span class='fa fa-sort'></span></td>
                    <td>生成时间<span class='fa fa-sort'></span></td>
                    <td>上线时间<span class='fa fa-sort'></span></td>
                    <td>状态<span class='fa fa-sort'></span></td>
                    <td>操作<span class='fa fa-sort'></span></td>
                </tr>
                <tr ng-repeat='item in list'>
                    <td>{{item.id || '未知'}}</td>
                    <td>{{item.title || '未知'}}</td>
                    <td><a href='{{item.picture}}' target='_blank'>查看</a></td>
                    <td>{{item.audio_time || 0}} ``</td>
                    <td>{{item.create_date || '未知'}}</td>
                    <td>{{item.online_date || '未知'}}</td>
                    <td>
                        <span class='label label-success' ng-if='item.status == 1'>
                            {{item.status_text || '未知'}}
                        </span>
                        <span class='label label-warning' ng-if='item.status == 2'>
                            {{item.status_text || '未知'}}
                        </span>
                    </td>
                    <td>
                        <button class='btn btn-primary btn-xs btn-w-xs' ng-click='get_item(item)'>详情</button>
                        <button class='btn btn-danger btn-xs btn-w-xs' 
                            ng-click='update_item(item.id, {"status" : "-1"})'>
                            删除
                        </button>
                    </td>
                </tr>
            </table>
            <div class='box-page' ng-bind-html='pageHtml'></div>
        </div>
	</div>

    <!-- 语录添加modal -->
    <div class='modal fade add-motto'>
        <div class='modal-dialog'>
            <div class='modal-content' align='center'>
                <div class='modal-header'>
                    语录添加
                    <a class='close' data-dismiss='modal'>&times;</a>
                </div>
                <div class='modal-body'>
                    <table class='table-form'>
                        <tr>
                            <td class='td-label'>标题:</td>
                            <td colspan='3'>
                                <input type='text' class='form-control' ng-model='aItem.title'>
                            </td>
                        </tr>
                        <tr>
                            <td class='td-label'>上线时间:</td>
                            <td colspan='3'>
                                <input type='text' class='form-control input-date' ng-model='aItem.online_date'>
                            </td>
                        </tr>
                        <tr>
                            <td class='td-label'>声音:</td>
                            <td colspan='2'>
                                <span ng-if=' aItem.audio'>已上传</span>
                                <span ng-if='!aItem.audio'>未上传</span>
                            </td>
                            <td>
                                <div class='box-upload'>
                                    <button class='btn btn-success btn-upload-show'>上传</button>
                                    <button class='btn-upload' id='upload-audio-add'>上传</button>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td class='td-label'>图片:</td>
                            <td colspan='2' class='box-banner'>
                                <img ng-src='{{aItem.picture}}'>
                            </td>
                            <td>
                                <div class='box-upload'>
                                    <button class='btn btn-success btn-upload-show'>上传</button>
                                    <button class='btn-upload' id='upload-picture-add'>上传</button>
                                </div>
                            </td>
                        </tr>
                        <tr><td colspan='4' style='text-align: center'>
                            <span class='font-tip'>图片尺寸：600*600 格式：jpg
                        </td></tr>
                    </table>
                </div>
                <div class='modal-footer'>
                    <button class='btn btn-primary btn-sm btn-w-sm' ng-click='add_item(aItem)'>确认</button>
                    <button class='btn btn-default btn-sm btn-w-sm' data-dismiss='modal'>取消</button>
                </div>
            </div>
        </div>
    </div>

    <!-- 语录编辑modal -->
    <div class='modal fade get-motto'>
        <div class='modal-dialog'>
            <div class='modal-content' align='center'>
                <div class='modal-header'>
                    语录编辑
                    <a class='close' data-dismiss='modal'>&times;</a>
                </div>
                <div class='modal-body'>
                    <table class='table-form'>
                        <tr>
                            <td class='td-label'>标题:</td>
                            <td colspan='3'>
                                <input type='text' class='form-control' ng-model='nItem.title'>
                            </td>
                        </tr>
                        <tr>
                            <td class='td-label'>上线时间:</td>
                            <td colspan='3'>
                                <input type='text' class='form-control input-date' ng-model='nItem.online_date' disabled>
                            </td>
                        </tr>
                        <tr>
                            <td class='td-label'>声音:</td>
                            <td colspan='2'>
                                <span ng-if=' nItem.audio'>已上传</span>
                                <span ng-if='!nItem.audio'>未上传</span>
                            </td>
                            <td>
                                <div class='box-upload'>
                                    <button class='btn btn-success btn-upload-show'>上传</button>
                                    <button class='btn-upload' id='upload-audio-update'>上传</button>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td class='td-label'>图片:</td>
                            <td colspan='2' class='box-banner'>
                                <img ng-src='{{nItem.picture}}'>
                            </td>
                            <td>
                                <div class='box-upload'>
                                    <button class='btn btn-success btn-upload-show'>上传</button>
                                    <button class='btn-upload' id='upload-picture-update'>上传</button>
                                </div>
                            </td>
                        </tr>
                    </table>
                </div>
                <div class='modal-footer'>
                    <button class='btn btn-primary btn-sm btn-w-sm' ng-click='update_item(nItem.id, nItem)'>确认</button>
                    <button class='btn btn-default btn-sm btn-w-sm' data-dismiss='modal'>取消</button>
                </div>
            </div>
        </div>
    </div>
</div>